<?php
/*
 * класс отвечает за отображение страницы определенного юзера
 */
class Control_UserAction extends Control_Action{
    
    public function setArgs($args = null) {
        if (null != $args){
            $this->args = $args;
        }
        return $this;
    }
    public function setView($view) {
        if (null != $view){
            $this->view = $view;
        }
        return $this;
    }
    public function run(){
        $t = Model_File::getSTime();
        foreach($this->args as $k => $v){//получаем id авторизовавшегося юзера
            unset($this->args);
            $this->args = $k;
        }
        $userModel = Model_UserMapper::getThisUser($this->args);
        $messageModel = new Model_MessageMapper;
        $this->view->message = $messageModel->getUsersMessage($this->args);
        $this->view->user = $userModel;
        $this->view->setInnerTemplate('user');
        $_SESSION['time'] = Model_File::getTime($t);
        $_SESSION['memory'] = memory_get_usage();
        
    }
}
